Verifies an image in an application matches an expected image.
This statement compares the screenshot captured for the action performed in the previous statement with an expected image. If it does not match the expected image to a specified accuracy percentage, the script fails or continues and displays a message in the Errors pane. For example, if the accuracy percentage is 84% and the accuracy calculated during playback is 80%, the checkpoint fails. See Creating image checkpoints.
Syntax
CheckpointImage(MinimumAccuracy, "ExpectedImagePath", Left, Top, Width, Height, FailureBehavior, "Warning")
Arguments
| Argument | Description |
|---|---|
| MinimumAccuracy | Minimum percentage of accuracy required to pass the checkpoint. |
| ExpectedImagePath | Path to the expected image (e.g., C:\\Images\\myimage.png). |
| Left | Integer pixel value of the left side of the rectangle that contains area to verify. |
| Top | Integer pixel value of the top side of the rectangle that contains area to verify. |
| Width | Integer pixel value of the width of the rectangle that contains area to verify. |
| Height | Integer pixel value of the height of the rectangle that contains area to verify. |
| FailureBehavior | Optional failure behavior. True stops the script if the checkpoint fails. False displays a warning and continues playback. If not specified, True is used. |
| Warning | Optional message to display in the Errors pane and run report when checkpoints fail. |
Example
CheckpointImage(90, "C:\\Testing\\Images\\logo.png", 2, 0, 318, 205, False, "Image is incorrect")